import { setStorage, getStorage } from '@/components/storybook/utilties/storage'
import { device, groupMergeFlag } from '@/components/storybook/settings/website'

export default {
  state: {
    device: getStorage('device') || device,
    groupMergeFlag: groupMergeFlag,
    loginRouter: getStorage('loginRouter') || '/login'
  },
  mutations: {
    SET_DEVICE: (state, device) => {
      state.device = device
      setStorage('device', device)
    },

    SET_LOGIN_ROUTER: (state, loginRouter) => {
      state.loginRouter = loginRouter
      setStorage('loginRouter', loginRouter)
    },
    SET_UPGRADE_SQL: state => {
      state.groupMergeFlag = !state.groupMergeFlag
    }
  },
  actions: {}
}
